'use strict';

const Controller = require('egg').Controller;

class NewsController extends Controller {
  async content() {
    // 获取get传值
    var aid = this.ctx.query.aid;
    // 获取新闻详情数据 -- 去service请求接口
    // console.log(aid);
    var content = await this.service.news.getNewsContent(aid)
    console.log(content);
    await this.ctx.render('newscontent', {
      content: content[0]
    })
  }
}

module.exports = NewsController;
